# 抖码算法，让算法学习变得简单有趣
# 作者：老汤


class Node:
    def __init__(self, val, children):
        self.val = val
        self.children = children


def pre_order(root):
    if root is None:
        return
    print(root.val)
    for child in root.children:
        pre_order(child)


def post_order(root):
    if root is None:
        return
    for child in root.children:
        post_order(child)
    print(root.val)